
/* First created by JCasGen Mon Mar 28 12:51:53 CEST 2011 */
package ia1011.zanzibar.chaos.type;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;

/** A Constituent is a contiguos portion of a Phrase acting as a syntactic unit. A Constituent is a tree structure. Leaves are simple constituents (SimpleConstituent) and intermediate nodes are complex constituents (ComplexConstituent).
 * Updated by JCasGen Mon Mar 28 12:52:46 CEST 2011
 * @generated */
public class UimaConstituent_Type extends Annotation_Type {
  /** @generated */
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator = 
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (UimaConstituent_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = UimaConstituent_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new UimaConstituent(addr, UimaConstituent_Type.this);
  			   UimaConstituent_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new UimaConstituent(addr, UimaConstituent_Type.this);
  	  }
    };
  /** @generated */
  public final static int typeIndexID = UimaConstituent.typeIndexID;
  /** @generated 
     @modifiable */
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("ia1011.zanzibar.chaos.type.UimaConstituent");
 
  /** @generated */
  final Feature casFeat_id;
  /** @generated */
  final int     casFeatCode_id;
  /** @generated */ 
  public int getId(int addr) {
        if (featOkTst && casFeat_id == null)
      jcas.throwFeatMissing("id", "ia1011.zanzibar.chaos.type.UimaConstituent");
    return ll_cas.ll_getIntValue(addr, casFeatCode_id);
  }
  /** @generated */    
  public void setId(int addr, int v) {
        if (featOkTst && casFeat_id == null)
      jcas.throwFeatMissing("id", "ia1011.zanzibar.chaos.type.UimaConstituent");
    ll_cas.ll_setIntValue(addr, casFeatCode_id, v);}
    
  
 
  /** @generated */
  final Feature casFeat_kind;
  /** @generated */
  final int     casFeatCode_kind;
  /** @generated */ 
  public String getKind(int addr) {
        if (featOkTst && casFeat_kind == null)
      jcas.throwFeatMissing("kind", "ia1011.zanzibar.chaos.type.UimaConstituent");
    return ll_cas.ll_getStringValue(addr, casFeatCode_kind);
  }
  /** @generated */    
  public void setKind(int addr, String v) {
        if (featOkTst && casFeat_kind == null)
      jcas.throwFeatMissing("kind", "ia1011.zanzibar.chaos.type.UimaConstituent");
    ll_cas.ll_setStringValue(addr, casFeatCode_kind, v);}
    
  
 
  /** @generated */
  final Feature casFeat_coindex;
  /** @generated */
  final int     casFeatCode_coindex;
  /** @generated */ 
  public int getCoindex(int addr) {
        if (featOkTst && casFeat_coindex == null)
      jcas.throwFeatMissing("coindex", "ia1011.zanzibar.chaos.type.UimaConstituent");
    return ll_cas.ll_getIntValue(addr, casFeatCode_coindex);
  }
  /** @generated */    
  public void setCoindex(int addr, int v) {
        if (featOkTst && casFeat_coindex == null)
      jcas.throwFeatMissing("coindex", "ia1011.zanzibar.chaos.type.UimaConstituent");
    ll_cas.ll_setIntValue(addr, casFeatCode_coindex, v);}
    
  
 
  /** @generated */
  final Feature casFeat_coindex_type;
  /** @generated */
  final int     casFeatCode_coindex_type;
  /** @generated */ 
  public String getCoindex_type(int addr) {
        if (featOkTst && casFeat_coindex_type == null)
      jcas.throwFeatMissing("coindex_type", "ia1011.zanzibar.chaos.type.UimaConstituent");
    return ll_cas.ll_getStringValue(addr, casFeatCode_coindex_type);
  }
  /** @generated */    
  public void setCoindex_type(int addr, String v) {
        if (featOkTst && casFeat_coindex_type == null)
      jcas.throwFeatMissing("coindex_type", "ia1011.zanzibar.chaos.type.UimaConstituent");
    ll_cas.ll_setStringValue(addr, casFeatCode_coindex_type, v);}
    
  
 
  /** @generated */
  final Feature casFeat_isTheMain;
  /** @generated */
  final int     casFeatCode_isTheMain;
  /** @generated */ 
  public boolean getIsTheMain(int addr) {
        if (featOkTst && casFeat_isTheMain == null)
      jcas.throwFeatMissing("isTheMain", "ia1011.zanzibar.chaos.type.UimaConstituent");
    return ll_cas.ll_getBooleanValue(addr, casFeatCode_isTheMain);
  }
  /** @generated */    
  public void setIsTheMain(int addr, boolean v) {
        if (featOkTst && casFeat_isTheMain == null)
      jcas.throwFeatMissing("isTheMain", "ia1011.zanzibar.chaos.type.UimaConstituent");
    ll_cas.ll_setBooleanValue(addr, casFeatCode_isTheMain, v);}
    
  
 
  /** @generated */
  final Feature casFeat_morphologicalFeatures;
  /** @generated */
  final int     casFeatCode_morphologicalFeatures;
  /** @generated */ 
  public String getMorphologicalFeatures(int addr) {
        if (featOkTst && casFeat_morphologicalFeatures == null)
      jcas.throwFeatMissing("morphologicalFeatures", "ia1011.zanzibar.chaos.type.UimaConstituent");
    return ll_cas.ll_getStringValue(addr, casFeatCode_morphologicalFeatures);
  }
  /** @generated */    
  public void setMorphologicalFeatures(int addr, String v) {
        if (featOkTst && casFeat_morphologicalFeatures == null)
      jcas.throwFeatMissing("morphologicalFeatures", "ia1011.zanzibar.chaos.type.UimaConstituent");
    ll_cas.ll_setStringValue(addr, casFeatCode_morphologicalFeatures, v);}
    
  
 
  /** @generated */
  final Feature casFeat_alternativeLemmas;
  /** @generated */
  final int     casFeatCode_alternativeLemmas;
  /** @generated */ 
  public int getAlternativeLemmas(int addr) {
        if (featOkTst && casFeat_alternativeLemmas == null)
      jcas.throwFeatMissing("alternativeLemmas", "ia1011.zanzibar.chaos.type.UimaConstituent");
    return ll_cas.ll_getRefValue(addr, casFeatCode_alternativeLemmas);
  }
  /** @generated */    
  public void setAlternativeLemmas(int addr, int v) {
        if (featOkTst && casFeat_alternativeLemmas == null)
      jcas.throwFeatMissing("alternativeLemmas", "ia1011.zanzibar.chaos.type.UimaConstituent");
    ll_cas.ll_setRefValue(addr, casFeatCode_alternativeLemmas, v);}
    
   /** @generated */
  public int getAlternativeLemmas(int addr, int i) {
        if (featOkTst && casFeat_alternativeLemmas == null)
      jcas.throwFeatMissing("alternativeLemmas", "ia1011.zanzibar.chaos.type.UimaConstituent");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_alternativeLemmas), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_alternativeLemmas), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_alternativeLemmas), i);
  }
   
  /** @generated */ 
  public void setAlternativeLemmas(int addr, int i, int v) {
        if (featOkTst && casFeat_alternativeLemmas == null)
      jcas.throwFeatMissing("alternativeLemmas", "ia1011.zanzibar.chaos.type.UimaConstituent");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_alternativeLemmas), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_alternativeLemmas), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_alternativeLemmas), i, v);
  }
 



  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public UimaConstituent_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

 
    casFeat_id = jcas.getRequiredFeatureDE(casType, "id", "uima.cas.Integer", featOkTst);
    casFeatCode_id  = (null == casFeat_id) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_id).getCode();

 
    casFeat_kind = jcas.getRequiredFeatureDE(casType, "kind", "uima.cas.String", featOkTst);
    casFeatCode_kind  = (null == casFeat_kind) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_kind).getCode();

 
    casFeat_coindex = jcas.getRequiredFeatureDE(casType, "coindex", "uima.cas.Integer", featOkTst);
    casFeatCode_coindex  = (null == casFeat_coindex) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_coindex).getCode();

 
    casFeat_coindex_type = jcas.getRequiredFeatureDE(casType, "coindex_type", "uima.cas.String", featOkTst);
    casFeatCode_coindex_type  = (null == casFeat_coindex_type) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_coindex_type).getCode();

 
    casFeat_isTheMain = jcas.getRequiredFeatureDE(casType, "isTheMain", "uima.cas.Boolean", featOkTst);
    casFeatCode_isTheMain  = (null == casFeat_isTheMain) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_isTheMain).getCode();

 
    casFeat_morphologicalFeatures = jcas.getRequiredFeatureDE(casType, "morphologicalFeatures", "uima.cas.String", featOkTst);
    casFeatCode_morphologicalFeatures  = (null == casFeat_morphologicalFeatures) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_morphologicalFeatures).getCode();

 
    casFeat_alternativeLemmas = jcas.getRequiredFeatureDE(casType, "alternativeLemmas", "uima.cas.FSArray", featOkTst);
    casFeatCode_alternativeLemmas  = (null == casFeat_alternativeLemmas) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_alternativeLemmas).getCode();

  }
}



    